package com.tepth.busfix.main.alarm;

import com.tepth.busfix.bean.reponse.AlarmType;
import com.tepth.busfix.network.ApiModel;
import com.tepth.busfix.network.Network;

import java.util.List;

import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * Created by TMVPHelper on 2017/03/21
 */
public class AlarmInfoModel implements AlarmInfoContract.Model {

    @Override
    public Observable<ApiModel<List<AlarmType>>> getAlarmInfo(String authKey, String vehicleId) {
        return Network.getApiService().alarmInfo(authKey, vehicleId).subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }

    @Override
    public Observable<ApiModel<List<AlarmType>>> getAlarmInfoById(String authKey, String vehicleId, long id) {
        return Network.getApiService().alarmInfoByTrouble(authKey, vehicleId, id).subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }
}